package mo.offer_special;

public class L070 {

    public int singleNonDuplicate(int[] nums) {
        int left = 0;
        int right = nums.length - 1;
        while (left < right) {
            int mid = left + (right - left) / 2;
            mid -= mid & 1;
            if (nums[mid] == nums[mid+1]) {
                left += 2;
            } else {
                right = mid;
            }
        }
        return nums[left];
    }

}
